﻿// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");


// 构建责任链：Console → File → Email
var consoleLogger = new ConsoleLogger(LogLevel.Info);
var fileLogger = new FileLogger(LogLevel.Debug);
var emailLogger = new EmailLogger(LogLevel.Error);

consoleLogger.SetNext(fileLogger);
fileLogger.SetNext(emailLogger);

// 发送不同级别的日志
consoleLogger.LogMessage(LogLevel.Info, "用户登录");           // Console
consoleLogger.LogMessage(LogLevel.Debug, "数据库连接超时");   // Console + File
consoleLogger.LogMessage(LogLevel.Error, "系统崩溃！");       // Console + File + Email